package edu.bbu.commonproject.desktop.gui.view.swing.file.traffic.utils;

import java.awt.Dimension;
import java.awt.FlowLayout;

import javax.swing.ImageIcon;
import javax.swing.JButton;

import edu.bbu.commonproject.desktop.gui.view.swing.utils.Design;
import edu.bbu.commonproject.desktop.gui.view.swing.utils.TexturedPanel;
import edu.bbu.commonproject.desktop.gui.view.swing.utils.TransparentButton;

/**
 * The traffic control panel.
 */
public class TrafficControllerPanel extends TexturedPanel
{
	/** The start button. */
	private TransparentButton startButton; 
	
	/** The pause button.  */
	private TransparentButton pauseButton;
	
	/** The stop button. */
	private TransparentButton stopButton;
	
	/** The remove button. */
	private TransparentButton removeButton;
	
	/**
	 * The constructor.
	 */
	public TrafficControllerPanel()
	{
		this.setPreferredSize(new Dimension(100, 30));
		this.setLayout(new FlowLayout(FlowLayout.LEFT, 2, 1));
		
		this.setTexture(Design.FILELIST_CONTROL_BASETEXTURE);
		
		setComponents();
	}
	
	/**
	 * It sets the components.
	 */
	private void setComponents()
	{
		startButton = new TransparentButton();
		startButton.setIcon(new ImageIcon(Design.TRAFFIC_COMPONENT_START));
		startButton.setFocusable(false);
		startButton.setPreferredSize(new Dimension(30,30));
		
		pauseButton = new TransparentButton();
		pauseButton.setIcon(new ImageIcon(Design.TRAFFIC_COMPONENT_PAUSE));
		pauseButton.setFocusable(false);
		pauseButton.setPreferredSize(new Dimension(30,30));
		
		stopButton = new TransparentButton();
		stopButton.setIcon(new ImageIcon(Design.TRAFFIC_COMPONENT_STOP));
		stopButton.setFocusable(false);
		stopButton.setPreferredSize(new Dimension(30,30));
		
		removeButton = new TransparentButton();
		removeButton.setIcon(new ImageIcon(Design.TRAFFIC_COMPONENT_REMOVE));
		removeButton.setFocusable(false);
		removeButton.setPreferredSize(new Dimension(30,30));

		this.add(startButton);
		this.add(pauseButton);
		this.add(stopButton);
		this.add(removeButton);
	}
	
	/**
	 * The gets the start button.
	 * @return the start button.
	 */
	public TransparentButton getStartButton()
	{
		return startButton;
	}
	
	/**
	 * The gets the pause button.
	 * @return the pause button.
	 */
	public TransparentButton getPauseButton()
	{
		return pauseButton;
	}
	
	/**
	 * The gets the stop button.
	 * @return the stop button.
	 */
	public TransparentButton getStopButton()
	{
		return stopButton;
	}
	
	/**
	 * The gets the remove button.
	 * @return the remove button.
	 */
	public TransparentButton getRemoveButton()
	{
		return removeButton;
	}
}
